import type { PostPatientConsultOrderParams } from "@/types/consult";
import { defineStore } from "pinia";
import { ref } from "vue";

export type IllnessInfoType = Pick<PostPatientConsultOrderParams, 
'illnessDesc' | 'illnessTime' | 'consultFlag' | 'pictures' >
export const useUserConsultStore = defineStore('consult', () => {
  // 初始化参数
  const initalValue:IllnessInfoType = {
    illnessDesc: '',
    illnessTime: 2,
    consultFlag: 1,
    pictures: [],
  }
  // 病情描述
  const illnessInfo = ref<IllnessInfoType>
  ({...initalValue})
  // 极速问诊
  const type = ref('')
  // 问诊类型
  const illnessType = ref('')
  // 科室ID
  const depId = ref('')
   // 患者id
   const patientId = ref('')
   // 清空参数
   const clear = () => {
    illnessInfo.value = { ...initalValue }
    type.value = ''
    illnessType.value = ''
    depId.value = ''
    patientId.value = ''
  }
  return { illnessInfo,type,illnessType,depId ,patientId,clear}
},{persist:true})